//@author A0105735J
// Invoker is the class to store all the commands
// It also provide function for Analyzer to execute or undo a Command
// Command pattern is applied
#pragma once
#ifndef INVOKER_H
#define INVOKER_H
#include <vector>
#include "Command.h"
#include "Feedback.h"
#include "Receiver.h"

class Invoker
{
private:
	// the pointers of commands stored in invoker, which could be both executed and undo
	std::vector<Command*> undoList;
	Receiver* receiver;
public:
	Invoker(void);
	~Invoker(void);
	// for analyzer to store the command
	void storeCommand(Command*);
	// execute the command in undo list
	Feedback executeCommand();
	// undo the command in undo list
	Feedback undo();
};
#endif
